{include file=header.html}
<style type="text/css">
.search th{border:1px solid #ccc;background:#E6EFF6;font-weight:normal;}
.search td{border:1px solid #ccc;}
</style>
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/lan.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
<script language="javascript" type="text/javascript">
$(function() {
	$('th[type="order"]').click(function() {
		var order = $(this).attr('field') + '-' + $(this).attr('order');
		$('#order').val(order);
		$('input[name="search"]').click();
	}).css({'cursor': 'pointer', 'color': '#36c'});
	var order = $('#order').val().split('-');
	var field = $('th[type="order"][field="' + order[0] + '"]');
	if (order[1] == 'ASC') {
		field.attr('order', 'DESC').text(field.text() + '↑');
	} else {
		field.attr('order', 'ASC').text(field.text() + '↓');
	}
	if (order[0] != 'arrival_date') {
		$('th[type="order"][field="arrival_date"]').attr('order', 'DESC');
	}
});

function nl2br (str) {
var arr = str.split('\n');
var ret = '';
for (var i = 0; i < arr.length; i++) {
ret += arr[i];
if (i != arr.length - 1) {
ret += '<br>\n';
}
}
return ret;
}
</script>
<link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
.process_color{
	color:red
}
</style>
</head>
<body>
<div class="sub-body">
	<div id="head">
		<div  id="search">
			<form action="index.php" method="get">
					<table width="60%" cellspacing="0" cellpadding="0" class="search">
						<tr>
							<th width="100">款式：</th>
							<td width="200"><select name="style_id">
									<option value=" "></option>
									<!--{foreach from=$style_list item=style}-->
									<option value="{$style.style_id}" {if $style.style_id == $smarty.get.style_id}selected{/if}>{$style.style_name|escape}</option>
									<!--{/foreach}-->
								</select>
							</td>
                            <th width="100">品&nbsp;&nbsp;&nbsp;&nbsp;牌：</th>
							<td width="200"><select name="brand_id" id="brand_id">
									<option value=" "></option>
									<!--{foreach from=$brand_list item=brand key=k}-->
									<option value="{$brand.brand_id}"{if $smarty.get.brand_id == $brand.brand_id} selected{/if}>{$brand.brand_name}&nbsp;&nbsp;({$brand.company_name|escape})</option>
									<!--{/foreach}-->
								</select></td>
							<td width="100" rowspan="2"><input type="hidden" name="app" value="order" />
								<input type="hidden" name="act" value="same_style" />
								<input type="hidden" name="order" id="order" value="{if $smarty.get.order}{$smarty.get.order}{else}order_create_date-DESC{/if}" />
								<input type="submit" name="search" value="查询" class="inquiry" /></td>
                                	
						</tr>
						<tr>
						
							<th>买&nbsp;&nbsp;&nbsp;&nbsp;手：</th>
							<td><select name="buyer_id" id="buyer_id">
									<option value=" "></option>
									<!--{foreach from=$buyer_list item=buyer}-->
									<option value="{$buyer.user_id}"{if $smarty.get.buyer_id == $buyer.user_id} selected{/if}>{$buyer.user_name}</option>
									<!--{/foreach}-->
								</select></td>
                               	<th class="right">工&nbsp;&nbsp;&nbsp;&nbsp;厂：</th>
								<td><select name="factory_id" id="factory_id">
								<option value=" "></option>
								<!--{foreach from=$factory_list item=factory}-->
								<option value="{$factory.factory_id}"{if $smarty.get.factory_id == $factory.factory_id} selected{/if}>{$factory.factory_name}</option>
								<!--{/foreach}-->
								</select></td>
						</tr>

					</table>
				</form>
		</div>
	</div>
	<div class="Create" style="margin-top: 10px;">  </div>
	<div class="tab_info" id="order_list">
		<div class="tab-title-1">
			<span id="order_list_view" style="cursor: pointer;">同款比价列表</span>&nbsp;&nbsp;
		</div>
		<table width="100%" cellspacing="0" cellpadding="0" class="tab-display" id="tab-color1">
			<tr>
				<th width="3%">序号</th>
				<th width="4%" type="order" field="brand_name" order="ASC">品牌</th>
				<th width="6%" type="order" field="buyer_name" order="ASC">买手</th>
				<th width="6%" type="order" field="merchandiser" order="ASC">跟单</th>
				<th width="6%" type="order" field="order_sn" order="ASC">订单号</th>
				<th width="6%" type="order" field="style_name" order="ASC">款式</th>
				<th width="7%">图片</th>
				<th width="7%" type="order" field="factory_name" order="ASC">工厂</th>
				<th width="5%" type="order" field="factory_price" order="ASC">工厂价</th>
				<th width="5%" type="order" field="customer_price" order="ASC">客人价</th>
				<th width="5%">细节图</th>
				<th>面料信息</th>
			</tr>
			<!--{foreach from=$order_list item=order key=k name=o}-->
			<tr>
				<td>{$smarty.foreach.o.iteration}</td>
				<td>{$order.brand_name}</td>
				<td>{$order.buyer_name}</td>
				<td>{$order.merchandiser}</td>
				<td><a href="{url app=order&act=view&id=$order.order_id}" style="color:blue">{$order.order_sn|default:-}</a>
                </td>
				<td>{$order.style_name}</td>
				<td><a href="{$site_url}/{$order.front_pic}" target="_blank"><img src="{$order.front_pic}" width="80" style="border:none;" alt="图片"/></a></td>
				<td>{$order.factory_name}</td>
				<td>{$order.factory_price|default:0}</td>
				<td>{$order.customer_price|default:0}</td>
				<td><a href="{url app=order&act=upload_thumb&order_id=$order.order_id}" target="_blank">查看</a></td>
				<td valign="top">
					<table width="100%" cellspacing="0" cellpadding="0">
                		<tr>
                			<th width="25%">面料描述</th>
                			<th width="20%">布行/档口</th>
                			<th width="20%">品名/货号</th>
                			<th width="10%">价格</th>
                			<th width="11%">幅宽</th>
                			<th width="14%">色卡照片</th>
                		</tr>
                		<!-- {foreach from=$order.order_fabric item=fabric} -->
                		<tr>
                			<td>{$fabric.description}</td>
                			<td>{$fabric.fabric_shop_name|escape}</td>
                			<td>{$fabric.item}</td>
                			<td>{$fabric.price|default:0}</td>
                			<td>{$fabric.width}</td>
                			<td><a href="{url app=colorcard&act=show&cc_id=$fabric.cc_id}"><img src="{$fabric.color_img}" width="80px" height="60px" title="色卡图片" /></a></td>
                		</tr>
                		<!-- {/foreach} -->
                	</table>
				</td>
			</tr>
			<!--{/foreach}-->
		</table>
		<div class="page"> {include file=page.html}</div>
	</div>
	<script language="JavaScript">
function create_order(){
location.href='index.php?app=order&act=add';
return;
$('#head').hide();
$('#order_list').hide();
$('#order_info').hide().load('{$siteurl}/index.php?app=order&act=add','',function(){
$.get('{$siteurl}/index.php?app=order&act=add',function(data){
$('#order_info').html(data);
});
$('#order_info').fadeIn('slow');});
}

</script>
	<div id="order_info"> </div>
</div>
<script language="javascript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
</body>
</html>
